;;; -*- Mode:LISP; Package:SYSTEM-INTERNALS; Readtable:CL; Base:10 -*-


(DEFUN SETUP (&OPTIONAL (SIZE (IF (BOUNDP '*DEFAULT-INDEX-ARRAY-SIZE*)
                                  *DEFAULT-INDEX-ARRAY-SIZE*
                                5000)))
  (SETQ *DEFAULT-INDEX-ARRAY-SIZE* SIZE)
  (SETQ *GLOBAL-INDEXED-CELL-ARRAY* (MAKE-ARRAY *DEFAULT-INDEX-ARRAY-SIZE*))
  (SETQ *INDEX-NAME-TABLE* (MAKE-ARRAY *DEFAULT-INDEX-ARRAY-SIZE*))
  (ADD-INITIALIZATION "RESET INDEXED-CELL-ARRAY"
                      '(SETQ *INDEXED-CELL-ARRAY* *GLOBAL-INDEXED-CELL-ARRAY*)
                      ;; :SYSTEM because the A-MEMORY location will be NIL on cold boot.
                      ;; :WARM to protect against blown-away bindings.
                      '(:SYSTEM :WARM :NOW))
  (SETQ *INDEX-UNALLOCATED* 0)
  (SETQ *INDEX-ALLOCATION-TABLE* (MAKE-HASH-TABLE :TEST #'EQUAL))
  (SETQ *CELL-ARRAYS* (LIST (MAKE-CELL-PLACE :ARRAY *GLOBAL-INDEXED-CELL-ARRAY*)))
  (SETQ *ASSOCIATED-INDEXED-CELL-ARRAYS* NIL)
  )


(OR (BOUNDP '*DEFAULT-INDEX-ARRAY-SIZE*)
    (SETUP))

;; set up in QFASL:

(SETQ *SNAP-INDEXED-FORWARDS* NIL)
